﻿using System.Collections.Generic;
using SCS.Common.Models;

namespace SCS.Business
{
    public enum LoginAttemptStatus
    {
        LoginSuccessful,
        UserNotFound,
        PasswordIncorrect,
        PasswordAttemptsExceeded,
        UserLockedOut,
        UserNotApproved,
    }
    public interface IMembershipService
    {
        IList<MembershipUser> GetAllTeacherUser();
        MembershipUser SanitizeUser(MembershipUser membershipUser);
        bool ValidateUser(string userName, string password, int maxInvalidPasswordAttempts);
        LoginAttemptStatus LastLoginStatus { get; }
        string[] GetRolesForUser(string username);
        MembershipUser GetUser(string username);
        MembershipUser GetUserByEmail(string email);
        IList<MembershipUser> GetUsersById(int id);
        MembershipUser GetUser(int id);
        MembershipUser SetRoleForTeacher(MembershipUser membershipUser, int roleID);
        bool ChangePassword(MembershipUser user, string oldPassword, string newPassword);
        bool ResetPassword(string userName, string phone, out string error, out string newPassword);
        void UnlockUser(string username, bool resetPasswordAttempts);
        MembershipCreateStatus CreateUser(MembershipUser newUser, int roleID);
        string ErrorCodeToString(MembershipCreateStatus createStatus);
        MembershipUser CreateEmptyUser();
        List<string> AutoComplete(string searchString);
        IList<MembershipUser> GetAll();
        IList<MembershipUser> SearchMembers(string username, int amount);
        void Save(MembershipUser user);
        void ProfileUpdated(MembershipUser user);
        void Delete(MembershipUser user);
        int MemberCount();
        int GetMemberID();
    }
}
